﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Weber.CS3280.Inventory.Logic;
using Weber.CS3280.Inventory.UI.ViewModels;
using Weber.CS3280.Inventory.UI.Windows;

namespace Weber.CS3280.Inventory.UI.Controls
{
	/// <summary>
	/// Interaction logic for ButtonMenuGrid.xaml
	/// </summary>
	public partial class ButtonMenuGrid : UserControl
	{
		

		public ButtonMenuGrid()
		{
			InitializeComponent();
		}

		private void btnClicker_Click(object sender, RoutedEventArgs e)
		{
			// Check the sender to determine which button raised the event
			Button btn = sender as Button;

			// Make sure 
			if (btn == null)
				return;

			Window window = Window.GetWindow(btn);

			if (object.ReferenceEquals(btn, btnTopLeft))
				SingleControlHostWindow.ShowWindow<ItemCategoryListingControl>(new ItemCategoryListViewModel(), window);
			else if (object.ReferenceEquals(btn, btnTopRight))
				SingleControlHostWindow.ShowWindow<InventoryListingControl>(new InventoryListViewModel(), window);

			//string content = btn.Content as string;

			//if (!string.IsNullOrEmpty(content))
			//	btn.Content = null;
			//else
			//	btn.Content = "Clicked";

			// If we were doing some thing special with each of these, 
			// we would evaluate these individually
			//if (object.ReferenceEquals(btn, btnTopLeft))
			//{
			//}
			//else if (object.ReferenceEquals(btn, btnTopRight))
			//{
			//	btnTopRight.Content = 
			//}
			//else if (object.ReferenceEquals(btn, btnBottomLeft))
			//{

			//}
			//else if (object.ReferenceEquals(btn, btnBottomRight))
			//{

			//}
		}
	}
}
